<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/1/28 0028
  Time: 18:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/layui2.45/css/layui.css" type="text/css" />
    <script type="text/javascript" src="/layui2.45/layui.js"></script>
</head>
<body>
<h1>这里是商品列表</h1>
<table id="demo" lay-filter="test"></table>
<script>
    layui.use('table', function(){
        var table = layui.table;
        //第一个实例
        table.render({
            elem: '#demo'
            ,height: 500
            ,url: '/getAllProduct' //数据接口
            ,page: true //开启分页
            ,limit:10
            ,cols: [[ //表头
                {field: 'pid', title: 'ID', fixed: 'left'}
                ,{field: 'name', title: '商品名称'}
                ,{field: 'marketPrice', title: '商城价'}
                ,{field: 'shopPrice', title: '在售价'}
                ,{field: 'image', title: '图片'}
                ,{field: 'date', title: '日期'}
                ,{field: 'desc', title: '商品描述'}
            ]]
        });
    });
</script>
</body>
</html>
